package com.cds.drizzt.controller;

import com.cds.drizzt.entity.JsonResult;
import com.cds.drizzt.utils.enums.HttpCodeEnum;
import org.springframework.boot.web.servlet.error.ErrorController;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class CustomErrorController implements ErrorController {
    @RequestMapping("/error")
    public JsonResult<String>  error() {
        return JsonResult.error(
                HttpCodeEnum.RC404.getCode(),
                HttpCodeEnum.RC404.getMsg()
        );
    }
}
